<?php
namespace app\mouth\common;
use think\Validate;
class UserValidate extends Validate{

    protected $rule =   [
        'name'          => 'require|max:25',
        'age'           => 'number|between:1,120',
        'email'         => 'email',
        'password'      =>  'require|min:6|max:12'
    ];
    protected $message  =   [
        'name.require'          => '名称必须',
        'name.max'              => '名称最多不能超过25个字符',
        'age.number'            => '年龄必须是数字',
        'age.between'           => '年龄只能在1-120之间',
        'email'                 => '邮箱格式错误',
        'password.require'      =>  '请输入密码',
        'password.min'          =>  '密码需介于6-12位',
        'password.max'          =>  '密码需介于6-12位',
    ];
}
